#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<queue>
using namespace std;




class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};
vector<vector<int>> levelOrder(Node* root) {
    queue<Node*> q;
    vector<vector<int>> ret;
    if (root == nullptr)
    {
        return ret;
    }
    q.push(root);
    while (!q.empty())
    {
        int sz = q.size();
        vector<int> temp;
        for (int i = 0; i < sz; i++)
        {
            Node* cur = q.front();
            q.pop();
            temp.push_back(cur->val);
            if (cur != nullptr)
            {
                for (int k = 0; k < cur->children.size(); k++)
                {
                    if (cur->children[k] != nullptr)
                    {
                        q.push(cur->children[k]);
                    }
                }
            }
        }
        ret.push_back(temp);
    }

    return ret;
}



int main()
{
    return 0;
}